import React, {PureComponent} from "react"
import "./index.less"
import {ArrowLeftOutlined} from '@ant-design/icons';
import {PageHeader, Table} from "antd";
import SearchAutoComplete from "libs/search-auto-complete"
import columns from "./columns"
import {withRouter} from "react-router"
import makeRequestCompose from "./compose"
import {appContext} from "context/app-context"
import cs from "classnames"


export default @withRouter
@appContext
@makeRequestCompose
class MyFavorite extends PureComponent {

  constructor(props) {
    super(props)
  }

  render() {
    const {
      loading,
      pagination,
      dataSource,
      onFastSearch,
      onPageChange,
      onView,
      onDel
    } = this.props

    return (
      <div className={'zr-panel'}>

        <div className={'zr-panel-header'}>
          <div>
            {/*<Breadcrumb>*/}
            {/*  <Breadcrumb.Item><Link to="/app/home"><LegacyIcon type={'home'}/></Link></Breadcrumb.Item>*/}
            {/*  <Breadcrumb.Item>制版请求</Breadcrumb.Item>*/}
            {/*</Breadcrumb>*/}
            <PageHeader backIcon={<ArrowLeftOutlined/>}
                        onBack={() => window.history.back()} title={`制版请求`}
                        subTitle={`对缺失版型平台服装提交的制版请求`}/>
          </div>
        </div>
        <div className={'ld2-list-page-box absolute'}>
          <div className={cs('ld2-query-box')}>
            <SearchAutoComplete allowClear={true} onSubmit={onFastSearch} placeholder={'请输入服装编号查询'}/>
            <div style={{width: '20px'}}></div>
          </div>
          <div className={'ld2-table-box'}>
            <Table
              rowKey={record => record.id}
              onChange={onPageChange}
              loading={loading}
              pagination={pagination}
              size={'middle'}
              columns={columns({onDel, onView})}
              dataSource={dataSource}/>
          </div>
        </div>
      </div>
    );
  }

}


